package org.linlinjava.litemall.admin.web2.system.dto.resp;

import org.linlinjava.litemall.db.domain.TCoupon;
import org.linlinjava.litemall.db.enumeration.Const;

import java.time.LocalDateTime;

public class Resp3 {
    private Integer id;

    private String category;


    private String type;


    private Integer amount;


    private Integer min;


    private LocalDateTime beginTime;


    private LocalDateTime endTime;


    private Integer expireTime;


    private Boolean enable;

    public Resp3() {
    }

    public Resp3(TCoupon coupon) {
        this.id = coupon.getId();
        this.amount = coupon.getAmount();
        this.category = coupon.getCategory() == 0 ? "红包" : "优惠券";
        this.type = Const.COUPON_TYPE.value(coupon.getType());
        this.min = coupon.getMin();
        this.beginTime = coupon.getBeginTime();
        this.endTime = coupon.getEndTime();
        this.expireTime = coupon.getExpireTime();
        this.enable = coupon.getOpen();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }


    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public Integer getMin() {
        return min;
    }

    public void setMin(Integer min) {
        this.min = min;
    }

    public LocalDateTime getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(LocalDateTime beginTime) {
        this.beginTime = beginTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public Integer getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Integer expireTime) {
        this.expireTime = expireTime;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }
}
